<template>
  <div style="height:100%">
    <h1 v-show="isflag">哈哈</h1>
    <!-- 路由插槽 -->
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "Summary",
  data() {
    return {
      title: "父路由"
    }
  },
  computed: {
    isflag() {
      return this.$route.name === this.$options.name
    }
  },
  // watch: {
  //   $route: {
  //     immediate: true,
  //     handler(to,from) {
  //       console.log(from);// 从哪来
  //       console.log(to);// 到哪去
  //     }
  //   }
  // },
}
</script>

<style lang="scss">

</style>
